export const getResourceUrl = (fileName) => {
    if (!fileName) return '/default-avatar.png'
    
    try {
      // 处理 Windows 路径问题
      const cleanName = fileName.replace(/\\/g, '/').split('/').pop()
      return 'http://localhost:8081/avatars/' + encodeURIComponent(cleanName)
    } catch (error) {
      console.error('解析文件路径错误:', error)
      return '/default-avatar.png'
    }
  }